#!/bin/bash
printf "\e[0;32m数据写入硬盘中,请稍等\e[0m\n"

#写入硬盘，防止数据丢失
sync;sync;sync

printf "\e[5;33m正在清理缓存,请稍等\e[0m\n"

echo 3 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 1 > /proc/sys/vm/drop_caches

free -h

